home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / java / slideshow / sources (skeleton) / slideshow.java < prev   
Encoding:
Java Source  |  2000-06-23  |  3.4 KB  |  141 lines

  1. import java.awt.*;
  2. import java.awt.event.ActionListener;
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.KeyEvent;
  5. import java.io.File;
  6. import java.util.Vector;
  7.  
  8. import com.apple.mrj.MRJApplicationUtils;
  9. import com.apple.mrj.MRJOpenDocumentHandler;
  10. import com.apple.mrj.MRJQuitHandler;
  11. import com.apple.mrj.MRJAboutHandler;
  12.  
  13. public class SlideShow extends Frame
  14. {
  15.     //Declare and define constants
  16.     //Insert "SlideShow Constants"
  17.  
  18.     //Declare data members
  19.     //Insert "SlideShow data members"
  20.  
  21.     //DECLARE_MENUS
  22.     //Declare Menus, Menu Items and the Menu Bar
  23.     //Insert "SlideShow declare menus"
  24.     
  25.     /**
  26.      * The entry point to our application
  27.      */
  28.     static public void main(String args[])
  29.     {
  30.         //Instantiate our SlideShow, make it visible, and register our MRJ handlers.
  31.         //Insert "SlideShow main"
  32.     }
  33.  
  34.     public SlideShow()
  35.     {    
  36.         //INIT_STATE
  37.         //Initialize state information
  38.         //Insert "SlideShow init state"
  39.         
  40.         //INIT_CONTROLS
  41.         //Setup and configure our SlideShow
  42.         //Insert "SlideShow init controls"
  43.  
  44.         //INIT_MENUS
  45.         //Create, configure, and setup the menubar, menus, and menu items.
  46.         //Insert "SlideShow init menus"
  47.         
  48.         //REGISTER_LISTENERS
  49.         //Register ActionListeners with the menu items and the controller.
  50.         //Insert "SlideShow register listeners"
  51.     }
  52.  
  53.     /**
  54.      * Starts or stops cycling forward through the list of image files to display.
  55.      */
  56.     public void togglePlaying()
  57.     {
  58.         //Handle starting and stopping the automatic progression of the show.
  59.         //Insert "SlideShow togglePlaying"
  60.     }
  61.     
  62.     //Inner class to implement our automatic progression of the show.
  63.     //Insert "SlideShow PlayRunnable"
  64.     
  65.     /**
  66.      * Steps the slide show forward or backwards by one image.
  67.      * @param if true, step forward, if false, step backward.
  68.      */
  69.     public void oneStep(boolean isForward)
  70.     {
  71.         //Handle stepping forward or backward in the list of image files,
  72.         //load the image, and repainting.
  73.         //Insert "SlideShow oneStep"
  74.     }
  75.     
  76.     /**
  77.      * Handles sizing of the window to utilize the full screen size, or to use the size of the image.
  78.      */
  79.     public void toggleFullScreen()
  80.     {
  81.         //Handle toggling the frame window size between the image size, screen size, and full screen.
  82.         //Insert "SlideShow toggleFullScreen"
  83.     }
  84.  
  85.     /**
  86.      * Shows or hides the control window.
  87.      */
  88.     public void toggleControls()
  89.     {
  90.         //Handle toggling the visibility of the controller
  91.         //Insert "SlideShow toggleControls"
  92.     }
  93.         
  94.     /**
  95.      * Gets called when the user chooses the Quit menu item, or when the
  96.      * application receives a quit message from the Finder (or other app).
  97.      */
  98.     protected void doOnQuit()
  99.     {
  100.         //Handle cleaning up, and quit.
  101.         //Insert "SlideShow doOnQuit"
  102.     }
  103.     
  104.     /**
  105.      * Gets called when the user selects the about menu item in the Apple Menu.
  106.      */
  107.     protected void doAbout()
  108.     {
  109.         //Handle displaying about information here
  110.         //Insert "SlideShow doAbout"
  111.     }
  112.  
  113.     public void paint(Graphics g)
  114.     {
  115.         //Handle scaling and drawing the image to fit in the frame content area.
  116.         //Insert "SlideShow paint"
  117.     }
  118.  
  119.     public void setVisible(boolean b)
  120.     {
  121.         //Make sure the controls are visible only when the frame is visible.
  122.         //Insert "SlideShow setVisible"
  123.     }
  124.     
  125.  
  126.     protected void registerMRJHandlers()
  127.     {
  128.         //Register MRJ handlers for open, about and quit.
  129.         //Insert "SlideShow registerMRJHandlers"
  130.     }
  131.  
  132.     //Inner class defining the MRJ Interface
  133.     //Insert "SlideShow MRJI"
  134.  
  135.     //Inner class for handling ActionEvents
  136.     //Insert "SlideShow Action"
  137.  
  138.     //Routines for handling the various ActionEvents
  139.     //Insert "SlideShow Action Management"
  140. }
  141.